home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / programming / oracle7 7.2 / DB / UTIL72 / EXAMP7.SQL < prev    next >
Encoding:
Text File  |  1995-05-18  |  1014 b   |  36 lines

  1. rem 
  2. rem $Header: examp7.sql 7020100.1 94/09/28 16:39:51 cli Generic<base> $ 
  3. rem 
  4. Rem  Copyright (c) 1991 by Oracle Corporation 
  5. Rem    NAME
  6. Rem      examp7.sql - <one-line expansion of the name>
  7. Rem    DESCRIPTION
  8. Rem      <short description of component this file declares/defines>
  9. Rem    RETURNS
  10. Rem 
  11. Rem    NOTES
  12. Rem      <other useful comments, qualifications, etc.>
  13. Rem    MODIFIED   (MM/DD/YY)
  14. Rem     rvasired   05/12/92 -  Creation 
  15. /*
  16. ** This block does some numeric processing on data that comes
  17. ** from experiment #1.  The results are stored in the TEMP table.
  18. **
  19. ** Copyright (c) 1989,1992 Oracle Corporation
  20. */
  21.  
  22. DECLARE
  23.     result  temp.num_col1%TYPE;
  24.     CURSOR c1 IS
  25.         SELECT n1, n2, n3 FROM data_table
  26.             WHERE exper_num = 1;
  27. BEGIN
  28.     FOR c1rec IN c1 LOOP
  29.             /* calculate and store the results */
  30.         result := c1rec.n2 / (c1rec.n1 + c1rec.n3);
  31.         INSERT INTO temp VALUES (result, NULL, NULL);
  32.     END LOOP;
  33.     COMMIT;
  34. END;
  35. /
  36.